<template>
  <div class="nav_bar">
    <div class="nav_bar_left">
      <div>
        <svg @click="$router.back()" style="height: 16px;width: 16px;" t="1624414066602" class="icon"
             viewBox="0 0 1024 1024" version="1.1"
             xmlns="http://www.w3.org/2000/svg" p-id="2400" width="200" height="200">
          <path
              d="M369.728 512l384.768-384.704a48.64 48.64 0 0 0 0.896-68.8 48.64 48.64 0 0 0-68.736 0.96L269.44 476.736a48.704 48.704 0 0 0-11.136 17.344c-1.024 2.304-1.024 4.736-1.472 7.04-0.896 3.648-2.048 7.168-2.048 10.88 0 3.712 1.152 7.232 1.984 10.88 0.512 2.368 0.512 4.8 1.472 7.04a48.704 48.704 0 0 0 11.136 17.344l417.216 417.28a48.576 48.576 0 0 0 68.736 0.96 48.576 48.576 0 0 0-0.896-68.736L369.728 512z"
              p-id="2401" fill="#fff"></path>
        </svg>
      </div>
    </div>
    <div class="nav_bar_right">
      <span @click="$router.push('/home/index')">返回首页</span>
      <span> | {{ username }}</span>
      <span @click="loginOut"> | 退出登录</span>
    </div>
  </div>
</template>

<script>
export default {
  computed: {
    username() {
      return sessionStorage.getItem('name') || ''
    }
  },
  methods: {
    loginOut() {
      this.$toast('退出登录成功')
      sessionStorage.clear()
      this.$router.push('/login')
    }
  }
}
</script>

<style scoped>

</style>
